﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AirSystem
{
    public class Ticket : IComparable<Ticket>
    {
        public string TicketID { get; set; }
        public string Kind { get; set; }
        public string Price { get; set; }

        public Ticket()
        {
            TicketID = string.Empty;
            Kind = string.Empty;
            Price = string.Empty;
        }
        #region IComparable<Ticket> Members

        public int CompareTo(Ticket other)
        {
            int thisPrice = Int32.Parse(Price.Replace(".",""));
            int otherPrice = Int32.Parse(other.Price.Replace(".", ""));
            if (otherPrice == thisPrice)
                return 0;
            if (otherPrice < thisPrice)
                return 1;
            return -1;
        }

        #endregion

    }
}
